package com.wc.alorithm_blue_bridge._排序.排个序;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/3/5 8:16
 * @description
 * https://www.lanqiao.cn/courses/46292/learning/?id=3436970&compatibility=false
 */
public class Main {
    /**
     * 思路：
     * 连续一段区间可以变化时, 这个区间就可以排序完成, 数据冒泡 / 插入
     * 枚举可以连续一段区间可以变化的即可
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 1010;
    static int[] a = new int[N];
    static boolean[] st = new boolean[N];
    static int n, m;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        while (m-- > 0) {
            int p = sc.nextInt();
            st[p] = st[p + 1] = true;
        }

        for (int i = 1; i <= n; i++) {
            if (st[i]) {
                int l = i, r = i;
                while (st[r]) r++;
                Arrays.sort(a, l, r);
                i = r;
            }
        }

        boolean res = true;
        for (int i = 1; i <= n; i++) {
            if (a[i] < a[i - 1]) {
                res = false;
                break;
            }
        }
        out.println(res ? "YES" : "NO");
        out.flush();
    }
}
class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

